package appfight.map;

import org.anddev.andengine.entity.sprite.Sprite;

import appfight.level.GameLevelMap;
import appfight.map.GameObjectMap.Map_Object;

public class NPC extends MapObject{

	protected GameLevelMap _level;
	protected Sprite _initSprite;
	protected Sprite _talkSprite;
	
	protected String _initString;
	protected String _talkString;
	
	public NPC(Map_Object objectType,GameLevelMap level,String initfaceSprite,String talkfaceSprite,int positionX,int positionY) {
		super(objectType);
		_level = level;
		_talkSprite = new Sprite(positionX *32 + 8,positionY *32 + 16,level._resoruceManager.IntelligentLoadTextureRegion(talkfaceSprite));
		_initSprite = new Sprite(positionX *32 + 8,positionY *32 + 16,level._resoruceManager.IntelligentLoadTextureRegion(initfaceSprite));
		_objectSprite = _initSprite;
		
		_talkSprite.setScale(2);
		_initSprite.setScale(2);
		
		_talkSprite.setPosition(-1000, -1000);
		
		_initString = initfaceSprite;
		_talkString = talkfaceSprite;
	}
	
	@Override
	public void Action()
	{
		super.Action();
		_talkSprite.setPosition(_initSprite.getInitialX(), _initSprite.getInitialY());
		_initSprite.setPosition(-1000, -1000);
	}
	
	@Override
	public void TalkEnd()
	{
		_initSprite.setPosition(_talkSprite.getInitialX(), _talkSprite.getInitialY());
		_talkSprite.setPosition(-1000, -1000);
		
	}

}
